package com.ifly.task.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @program: excel
 * @description: todo
 * @author: xuYao2
 * @create: 2022-07-21 23:28
 **/
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@HeadRowHeight(value = 25) // 头部行高
@ContentRowHeight(value = 15) // 内容行高
@ColumnWidth(value = 20) // 列宽
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 表头样式
@HeadFontStyle(fontName = "黑体")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 内容样式
public class CountryExcelVo {

    // 默认不展示的字段
    @ColumnWidth(value = 0)
    @ExcelProperty(value = {"国家列表", "编号"})
    private Long id;

    @ExcelProperty(value = {"国家列表", "国名"})
    private String countryName;

    @ExcelProperty(value = {"国家列表", "掌权者"})
    private String power;

    @ExcelProperty(value = {"国家列表", "丞相"})
    private String primeMinister;

    @ExcelProperty(value = {"国家列表", "建朝时间"})
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
